package com.hj.javaweb.controller;


import com.hj.javaweb.R.R;
import com.hj.javaweb.service.StudentService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * (Student)
 *
 * @author makejava
 * @since 2025-11-08 21:06:09
 */
@RestController
@RequestMapping("/student")
public class StudentController {

    @Resource
    private StudentService studentService;
    
    @GetMapping("/singleThread")
    public R<String> exportWithSingleThread(HttpServletResponse response) throws IOException {
        studentService.exportWithSingleThread(response);
        return R.ok("导出成功");
    }

    @GetMapping("/multiThread")
    public void exportWithMultiThread(HttpServletResponse response) throws IOException, InterruptedException {
        studentService.exportWithMultiThread(response);
    }
    
}

